package onjava.advance.ch01.sec11;

/**
 * RoShamBo3的简化版，代码简短却更难理解，不推荐用于大型系统，可能会削弱系统的可维护性
 */
//public enum RoShamBo4 implements CompetitorExt<RoShamBo4> {
//    ROCK {
//        @Override
//        public Outcome compete(RoShamBo4 loser, RoShamBo4 opponent) {
//            return compete(SCISSORS, opponent);
//        }
//    },
//    SCISSORS {
//        @Override
//        public Outcome compete(RoShamBo4 loser, RoShamBo4 opponent) {
//            return compete(PAPER, opponent);
//        }
//    },
//    PAPER {
//        @Override
//        public Outcome compete(RoShamBo4 loser, RoShamBo4 opponent) {
//            return compete(ROCK, opponent);
//        }
//    };
//
//    public Outcome compete(RoShamBo4 loser, RoShamBo4 opponent) {
//        return ((opponent == this) ? Outcome.DRAW
//                : (opponent == loser) ? Outcome.WIN : Outcome.LOSE);
//    }
//
//    public static void main(String[] args) {
//        RoShamBoExt.play(RoShamBo4.class, 20);
//    }
//}

